package com.neusoft.dibuy.th;

public class MyJoinApp {
    public static int sum = 0 ;
    public static void main(String[] args) throws InterruptedException {
       Thread thread1 =  new Thread(()-> {
            int sum = 0 ;
            for (int i = 1; i < 101; i++) {
                 sum+=i;
                try {
                    Thread.sleep(100);
                } catch (InterruptedException e) {
                    throw new RuntimeException(e);
                }
            }
            MyJoinApp.sum = sum;
        });
       thread1.start();
       System.out.println("MyJoinApp.main --------------");
       thread1.join();
       System.out.println("MyJoinApp.main" +  MyJoinApp.sum);
    }
}
